package lab01;

import java.util.Scanner;

public class Test08 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入1-100的数");
        int number = (int) (Math.random() * 100) + 1;

        for (int i = 1; i <= 100; i++) {

            int x = sc.nextInt();

            if (x < number) {
                System.out.println("sorry！小了点");
            }
            else if (x > number) {
                System.out.println("sorry！大了点");
            }
            else {
                System.out.println("恭喜中奖");
                System.out.println("猜的次数为：" + i);
            }
        }
    }
}
